package com.zhangxin.designmode.fiveprinciple.interfacesegregationprinciple.after;


/**
 * 更新和添加视图是两个不同的功能，编写两个接口Updater 和 Viewer , 将两个功能解耦
 * 扩展的时候用到哪个功能实现就可以
 *
 * @author zhangxin
 * @date 2022/4/11
 */
public class Application {

    public static final RedisConfig REDIS_CONFIG = new RedisConfig();
    public static final KafkaConfig KAFKA_CONFIG = new KafkaConfig();
    public static final MysqlConfig MYSQL_CONFIG = new MysqlConfig();

    public static void main(String[] args) {
        ScheduledUpdater redisScheduledUpdater = new ScheduledUpdater(300, 300, REDIS_CONFIG);
        redisScheduledUpdater.run();

        ScheduledUpdater kafkaScheduledUpdater = new ScheduledUpdater(60, 60, KAFKA_CONFIG);
        kafkaScheduledUpdater.run();

        SimpleHttpServer simpleHttpServer = new SimpleHttpServer("127.0.0.1", 8080);
        simpleHttpServer.addViewer("视图地址", MYSQL_CONFIG);

    }
}
